/**************************************************************************************
 *  Copyright (c)  2010  Leszek Karcz.
 *  Permission is granted to copy, distribute and/or modify this document
 *  under the terms of the GNU Free Documentation License, Version 1.3
 *  or any later version published by the Free Software Foundation;
 *  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 *  A copy of the license is included in the section entitled "GNU
 *  Free Documentation License". 
 **************************************************************************************/
package data;

/**************************************************************************************
 * Author(s): Leszek Karcz
 * This class keeps data for start screen view
 **************************************************************************************/
public class StartScreenData {
	private int selected;
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * StartScreenData constructor
	 **************************************************************************************/
	public StartScreenData()
	{
		this.selected=0;
	}
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * selects next
	 **************************************************************************************/
	public void next()
	{
		selected++;
		if(selected>1)
		{
			selected=0;
		}
	}
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * selects previous
	 **************************************************************************************/
	public void previous()
	{
		selected--;
		if(selected<0)
		{
			selected=1;
		}
	}
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * returns selects
	 **************************************************************************************/
	public int getSelected()
	{
		return this.selected;
	}
	
	/**************************************************************************************
	 * Author(s): Leszek Karcz
	 * executes the selected command
	 **************************************************************************************/
	public boolean execute()
	{
		if(this.getSelected()==0)
		{
			//go to gameplay
			return true;
		}
		else
		{
			//exit game
			System.exit(0);
			return false;
		}		
	}
}
